//
//  DemoViewController.swift
//  Inpro
//
//  Created by 彭灿 on 16/9/18.
//  Copyright © 2016年 Roble. All rights reserved.
//

import UIKit

class DemoViewController: MainBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //设置标题
        title = "第 \(navigationController?.childViewControllers.count ?? 0)个"
    }

    // MARK: - 监听方法
    /// 继续push 一个新控制器
    @objc public func showNext() {
        
        let vc = DemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension DemoViewController {
    
    override func setupUI() {
        super.setupUI()
        // 设置右侧的控制器
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}
